<!DOCTYPE html>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<html>
<head>
    <meta charset="utf-8">
    <title>Layui</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/layui/css/layui.css">
    <!-- 注意：如果你直接复制所有代码到本地，上述css路径需要改成你本地的 -->
</head>
<body>
<div id="test1"></div>

<%--<input type="hidden" value="${id}" id="id">--%>

<script src="${pageContext.request.contextPath}/static/layui/layui.js"></script>
<script>
    layui.use(['tree','jquery'], function(){
        var tree = layui.tree;
        var $=layui.$;
        $.get("${pageContext.request.contextPath}/role/permissions",function (result) {
            //渲染
            var inst1 = tree.render({
                elem: '#test1'  //绑定元素
                // ,showCheckbox:true
                ,data: result.data
            });
        },"json")

    });
</script>
</body>
</html>